﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using Mbl.ParameterizedTest.AcceptanceTests.CalculatorTests;

namespace Mbl.ParameterizedTest.AcceptanceTests.StringTests
{
    [TestClass]
    public class SubstringTests
    {
        [TestMethod]
        [ExpectedFailedTestCases(2, 3)]
        public void Contains_tests()
        {            
            ParameterizedTest
                .For<string>(s => s)
                .Given("asdf").ExpectContains("d").Because("It's right")
                .Given("asdf").ExpectContains("x").Because("It's wrong")
                .Given("asdf").ExpectContains("D").Because("It's wrong")
                .Evaluate();
        }

        [TestMethod]
        [ExpectedFailedTestCases(2, 3)]
        public void StartsWith_tests()
        {
            ParameterizedTest
                .For<string>(s => s)
                .Given("asdf").ExpectStartsWith("a").Because("It's right")
                .Given("asdf").ExpectStartsWith("x").Because("It's wrong")
                .Given("asdf").ExpectStartsWith("s").Because("It's wrong")
                .Evaluate();
        }

        [TestMethod]
        [ExpectedFailedTestCases(2, 3)]
        public void EndsWith_tests()
        {
            ParameterizedTest
                .For<string>(s => s)
                .Given("asdf").ExpectEndsWith("f").Because("It's right")
                .Given("asdf").ExpectEndsWith("x").Because("It's wrong")
                .Given("asdf").ExpectEndsWith("d").Because("It's wrong")
                .Evaluate();
        }
    }
}
